package sardine.exception;

import sardine.Request;
import sardine.Response;

/**
 * @auth bruce-sha
 * @date 2015/5/21
 */
public abstract class SimpleExceptionHandler implements ExceptionHandler {

    protected Class<? extends Exception> exceptionClass;

    public SimpleExceptionHandler(Class<? extends Exception> exceptionClass) {
        this.exceptionClass = exceptionClass;
    }

    public Class<? extends Exception> exceptionClass() {
        return this.exceptionClass;
    }

    public void exceptionClass(Class<? extends Exception> exceptionClass) {
        this.exceptionClass = exceptionClass;
    }

    public abstract void apply(Exception exception, Request request, Response response);
}
